const Controller = require('egg').Controller;

module.exports = class UserController extends Controller {
        // 获取集合信息
        async databaseCollectionGet() {
            const token = await this.ctx.service.wx.getToken();
            var url = `https://api.weixin.qq.com/tcb/databasecollectionget?access_token=${token}`
            const result = await this.ctx.curl(url, {
                // 必须指定 method
                method: 'POST',
                // 通过 contentType 告诉 HttpClient 以 JSON 格式发送
                contentType: 'json',
                data: {
                    env: 'bmg-test-3gt5ubuu31d80104',
                    limit: 10,
                    offset: 0
                },
                // 明确告诉 HttpClient 以 JSON 格式处理返回的响应 body
                dataType: 'json',
            });
            this.ctx.body = result.data
        }

    }
    // module.exports = UserController;